package com.yehongyu.mytools.basic.jdk5.enums;


public class TestforEnum {


	/**
	 * @param args
	 */
	public static void main(String[] args) {
		//获取当前Enum的所有常量
		for (Priority p : Priority.values()) {
			System.out.println(p.name());
		}
		//获取当前Enum的指定常量
		System.out.println(Priority.valueOf("Low"));
		//获取指定Enum的指定常量
		System.out.println(Enum.valueOf(Priority.class, "High"));
		
		//测试Enum的Switch语句
		Priority myType = Priority.High;
		switch (myType) {
		default:
		case High:
			System.out.println(myType);
			break;
		case Low:
			break;
		}
	}

}
